var express = require('express');
var router = express.Router();
var jwtTool = require("../app_modules/JwtTools.js");


router.get('/',function(req, res, next) {  
  if(jwtTool.getTokenObj(req).status)
    res.render('index', { title: 'user' });
  else
    res.render('login', { title: 'user' });
});

router.get('/index',function(req, res, next) {  
  if(jwtTool.getTokenObj(req).status)
    res.render('index', { title: 'user' });
  else
    res.render('login', { title: 'user' });
});

router.get('/PostTest',function(req, res, next) { 
    res.render('PostTest', { title: 'user' });
});


router.get('/login', function(req, res, next) {    
  if(jwtTool.getTokenObj(req).status)
    res.render('index', { title: 'user' });
  else
    res.render('login', { title: 'user' });
});


module.exports = router;